//
//  ARPictureView.m
//  AriseSamePro
//
//  Created by 包日守 on 15/11/5.
//  Copyright © 2015年 Arise. All rights reserved.
//

#import "ARPictureView.h"
#import "ARPictureController.h"


@interface ARPictureView ()

@end


@implementation ARPictureView



- (id) initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
        
        self.userInteractionEnabled = YES;
        
    }
    return self;
}



- (void) setImage:(UIImage *)image
{
    [super setImage:image];


}

- (void) awakeFromNib
{
    UITapGestureRecognizer *tap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(dealTap:)];
    [self addGestureRecognizer:tap];
    
    self.userInteractionEnabled = YES;
    

}

- (void) dealTap:(UITapGestureRecognizer *) tap
{
    ARPictureController *pVC = [[ARPictureController alloc] init];
    
    if (self.image) {
         pVC.arrayOfImages = @[self.image];
        
        if (self.superViewController) {
            
            [self.superViewController presentViewController:pVC animated:NO completion:nil];
        }

    }
   
    
    
}

@end
